#light

let squareEven n =
    async { do if n % 2 <> 0 then failwith "n must be even"
            return n *n }

let printResult (c: Choice<int,exn>) =
    match c with
    | Choice2_1 a -> print_any a
    | Choice2_2 b -> print_any b.Message

let result = Async.Run(Async.Catch(squareEven 3))

printResult result
